<template>
  <div>
    <el-button type="primary" @click="willAdd">添加</el-button>

    <v-list @edit="willEdit" :list="list" @init="init"></v-list>

    <v-form ref="form" :info="info" :list="list" @init="init"></v-form>
  </div>
</template>
<script>
import vList from "./components/list.vue";
import vForm from "./components/from.vue";
import { reqrolelist } from "../../request/api";
import toggle from "../../mixins/tooggle"
export default {
  mixins:[toggle],
  components: {
    vList,
    vForm,
  },
  mounted() {
      this.init()
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    init() {
      reqrolelist().then((res) => {
        if (res.data.code == 200) {
          this.list = res.data.list;
        }
      });
    },
  },
};
</script>
<style lang="less" scoped>
</style>